{template 'common/header'}
<title>加盟签约确认</title>
<style type="text/css">
    *{margin:auto;}
    body {margin:0; font-family:'微软雅黑'; background:#FFB72B;}
    .title{width:100%;height:150px;}
    .title img{width:100%;height:100%;}
    .content{width:80%;height:470px;position:relative;top:-30px;}
    .header-img{width:70px;height:70px;}
    .header-img img{width:100%;height:100%;border-radius:10px;}
    .header-title{height:30px;font-size:16px;color:#0E3672;font-weight:bold;margin-top:10px;text-align:center;}
    .price{width:50px;height:20px;font-size:14px;text-align:center;background:#70B0C3;color:#fff;border-radius:10px;line-height:20px;}
    .main{width:100%;height:320px;float:left;}
    .main .line{width:100%;height:50px;background:#fff;border-radius:10px;margin-top:10px;}
    .main .submit{width:100%;height:50px;background:#4BCFFF;border-radius:10px;margin-top:30px;text-align:center;line-height:50px;color:#fff;}
    .tubiao{width:50px;height:34px;border-right:2px solid #C6CED1;float:left;margin-top:8px;margin-left:10px;}
    .line .inner{width:200px;height:34px;float:left;margin-left:10px;margin-top:8px;}
    .line input {float:left; height:34px; width:100%; padding:0px; margin:0px; border:0px; outline:none; font-size:16px; color:#666;padding-left:5px;}
    .line select  {float:left; border:none;height:25px;width:100%;color:#666;font-size:16px;margin-top:10px;}
</style>
<div id='container'></div>
<div class="title">
    <img src="../addons/ewei_shop/template/mobile/default/static/images/jiameng/head2.jpg">
</div>
<div class='content'>
    <div class='header-img'><img src="../addons/ewei_shop/template/mobile/default/static/images/jiameng/type{$_GPC['product']}.jpg"></div>
    <div class="header-title">
        {if $_GPC['product']==1}美龄妈咪产后修复店中店{/if}
        {if $_GPC['product']==2}美龄范社区母婴店{/if}
        {if $_GPC['product']==3}AK系列产品{/if}
        {if $_GPC['product']==4}荷尔蒙系列{/if}
    </div>
    <div class="price">
        {if $_GPC['fangan']==1}2999{/if}
        {if $_GPC['fangan']==2}3999{/if}
    </div>
    <div class="main">
        <div class="line">
            <div class='tubiao'><img src='../addons/ewei_shop/template/mobile/default/static/images/jiameng/tubiao1.png'></div>
            <div class='inner'>
                <input type="text" id="name" value="" placeholder="姓名"/>
            </div>
        </div>
        <div class="line">
            <div class="line">
                <div class='tubiao'><img src='../addons/ewei_shop/template/mobile/default/static/images/jiameng/tubiao2.png'></div>
                <div class='inner'>
                    <input type="text" id="shop_name" value="" placeholder="门店名称"/>
                </div>
            </div>
        </div>
        <div class="line">
            <div class="line">
                <div class='tubiao'><img src='../addons/ewei_shop/template/mobile/default/static/images/jiameng/tubiao3.png'></div>
                <div class='inner'>
                    <input type="text" id="shop_address" value="" placeholder="门店地址"/>
                </div>
            </div>
        </div>
        <div class="line">
            <div class="line">
                <div class='tubiao'><img src='../addons/ewei_shop/template/mobile/default/static/images/jiameng/tubiao4.png'></div>
                <div class='inner'>
                    <input type="text" id="mobile" value="" placeholder="联系电话"/>
                </div>
            </div>
        </div>
        <div class="submit" id='submit'>确认</div>
    </div>
</div>
<script language="javascript">
    require(['tpl', 'core'], function(tpl, core) {
        $('#submit').click(function() {
            if ($(this).attr('saving') == '1') {
                return;
            }
            $(this).html('正在处理...').attr('saving', 1);
            if ($('#name').isEmpty()) {
                core.tip.show('请输入姓名!');
                return;
            }
            if ($('#shop_name').isEmpty()) {
                core.tip.show('请输入门店名称!');
                return;
            }
            if ($('#shop_address').isEmpty()) {
                core.tip.show('请输入门店地址!');
                return;
            }
            if ($('#mobile').isEmpty()) {
                core.tip.show('请输入联系电话!');
                return;
            }
            var data = {
                shop_type:"{$_GPC['product']}",
                type:"{$_GPC['fangan']}",
                name: $('#name').val(),
                shop_name: $('#shop_name').val(),
                shop_address: $('#shop_address').val(),
                mobile: $('#mobile').val()
            }
            core.json('franchise/list', {
                op: 'confirm',
                data: data
            }, function(postjson) {
                if (postjson.status == 1) {
                location.href ="{php echo $this->createMobileUrl('order/pay')}&franchise_order_id="+postjson.result.recordid;
                } else {
                     if(postjson.status== -1){
                     core.tip.show(postjson.result);
                     }else{
                     core.tip.show('操作失败');
                     }
                    $("#submit").html('确认').removeAttr('saving');
                }
            }, true, true);
        });
    });
</script>
{template 'common/footer'}